<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>详情页</title>
    <meta charset="utf-8"/>
    <link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css"/>
    <script src="https://cdn.bootcss.com/jquery/2.1.1/jquery.min.js"></script>
    <script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <script src="https://cdn.bootcss.com/jquery.countdown/2.2.0/jquery.countdown.js"></script>
    <script src="https://cdn.bootcss.com/jquery-cookie/1.4.1/jquery.cookie.js"></script>

</head>
<body>
<div class="container">

<div class="panel panel-default">
    <div class="panel-heading text-center">
        <h2 th:text="${seckill.name}"></h2>
        <button id="clearCook" class="btn btn-info">清除cookies</button>


    </div>

    <div class="panel-body text-center">
        <h2 class="text-danger">
            <!--显示time图标-->
            <span class="glyphicon glyphicon-time"></span>
            <!--展示倒计时-->
            <span class="glyphicon" id="seckill-box">seckill box</span>
        </h2>
    </div>



</div>
</div>

<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header text-center">
                <h4 class="modal-title" id="myModalLabel">
                    秒杀电话（必填）
                </h4>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-xs-8 col-xs-offset-2">
                        <input type="text" name="killPhone" id="killPhoneKey" placeholder="填写手机号^o^" class="form-control"/>
                    </div>
                    <div class="col-xs-8 col-xs-offset-2">
                        <span id="inputMessage"></span>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" id="killPhoneBtn" class="btn btn-success">
                    <span class="glyphicon glyphicon-phone"></span>
                    确定
                </button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>



</body>


<script th:inline="javascript" src="http://localhost:8080/seckill.js" type="text/javascript"></script>

<script type="text/javascript" th:inline="javascript">

    $(function () {
        //使用EL表达式传入参数
        console.log("init id = "+[[${seckill.id}]]);
        seckill.detail.init({
            seckillId:[[${seckill.id}]],
            startTime:[[${seckill.startTime.time}]],//毫秒
            endTime:[[${seckill.endTime.time}]]
        });
    })
</script>


</html>
